-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Fix GH-19044: Protected properties are not scoped according to their prototype #19046
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: PHP-8.4
Are you sure you want to change the base?
Conversation
e8099c0
to
e1008f8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for having a look at this.
@iluuu1994 May you please re-review now? :-) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As mentioned, I'd prefer to be inaccurate here and allow writes to protected(set)
siblings (linked through a common read-only parent). I don't think this is particularly important in practice.
I think we might opt into relaxing this eventually, but I would not allow more than actually needed at least for PHP 8.4. We can always revisit it, but I don't think we should do that now. |
@iluuu1994 Alright, let's just use prototype for everything. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you for the perseverance. 🙂
@@ -0,0 +1,26 @@ | |||
--TEST-- | |||
GH-19044: Protected properties must be scoped according to their prototype (hooks variation) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: We have gh19044.phpt and gh19044-1.phpt (along with other gh19044.phpt's), which is a bit confusing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So you'd rather have attached a number to them all? I thought first one without number and the extras get one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, or bump all the other ones by one so we don't have one with without prefix and one with -1
. Usually we'll have:
- gh123.phpt
- gh123-2.phpt
Or:
- gh123-1.phpt
- gh123-2.phpt
I prefer the latter, but either works.
This should properly cover all cases, especially also around set hooks which get added later on with protected(set) visibility.
Fixes #19044.